home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / ex / Vehicle.h < prev    next >
C/C++ Source or Header  |  1990-05-15  |  1KB  |  45 lines

  1. #ifndef VEHICLE_H
  2. #define VEHICLE_H
  3.  
  4. // $Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/ex/RCS/Vehicle.h,v 3.0 90/05/15 22:44:10 kgorlen Rel $
  5.  
  6. // Vehicle.h -- Abstract base class for various kinds of Vehicles
  7.  
  8. #ifndef MI
  9. #define MI
  10. #endif
  11.  
  12. #include "AllLink.h"
  13. #include "QLink.h"
  14. #include "AllVehicles.h"
  15. #include "IdentSet.h"
  16.  
  17. class Vehicle: public AllLink, public QLink {
  18.     DECLARE_MEMBERS(Vehicle);
  19.     static AllVehicles allVehicles;
  20.     static IdentSet v;                  // used by printOn()
  21.     unsigned id;
  22.     float height;
  23.     float length;
  24. public:         // static member functions
  25.     static void printAll(ostream& strm =cout);
  26.     static void saveQueues(const char* fname, ...);
  27. protected:      // storer() functions for object I/O
  28.     virtual void storer(OIOofd&) const;
  29.     virtual void storer(OIOout&) const;
  30. protected:
  31.     Vehicle(float h = 0.0, float l = 0.0);
  32.     virtual void _printOn(ostream& strm =cout) const;
  33. public:
  34.     virtual ~Vehicle();
  35.     bool operator==(const Vehicle&) const;
  36.     bool operator!=(const Vehicle& a) const { return !(*this==a); }
  37.     virtual int compare(const Object&) const;
  38.     virtual void deepenShallowCopy();
  39.     virtual unsigned hash() const;
  40.     virtual bool isEqual(const Object&) const;
  41.     virtual void printOn(ostream& strm =cout) const;
  42. };
  43.  
  44. #endif
  45.